#include<stdio.h>
#define d 8.38
int main() {
	int x1 = 0, q = 0, i = 0; double e = 0, l200 = 0, o1 = 0, z1 = 0,  dz1 = 0, zk1 = 0, l1 = 0;
	scanf("%d", &q);
	if (q >= 1 && q <= 10) {
	begin: scanf(" %d\n %lf", &x1, &l1);
		if (x1 >= 1&&x1<=7 && l1 >= 0 && l1 <= 50) {
			if (l1 == 0)
				return 0;
			else {
				l200 = 200 / d;
				z1 = d * l1;
				if (x1 != 5) {
					if (z1 >= 200) {
						o1 = z1;
						e = 20.00;
						l1 = l1 - l200;
						dz1 = l1 * 0.3;
						zk1 = o1 - e - dz1;
						printf("Order amount: %.2f\nE-coupon discount amount: %.2f\nDiscount amount: %.2f\nPayment amount: %.2f\n", o1, e, dz1, zk1);
					}
					else if (z1 > 0 && z1 < 200) {
						o1 = z1;
						e = 0.00;
						dz1 = l1 * 0.3;
						zk1 = o1 - e - dz1;
						printf("Order amount: %.2f\nE-coupon discount amount: %.2f\nDiscount amount: %.2f\nPayment amount: %.2f\n", o1, e, dz1, zk1);
					}
				}
				else {
					if (z1 >= 200) {
						o1 = z1;
						e = 20.00;
						l1 = l1 - l200;
						dz1 = l1 * (0.3 + 0.1);
						zk1 = o1 - e - dz1 + 0.01;
						printf("Order amount: %.2f\nE-coupon discount amount: %.2f\nDiscount amount: %.2f\nPayment amount: %.2f\n", o1, e, dz1, zk1);
					}
					else if (z1 > 0 && z1 < 200) {
						o1 = z1;
						e = 0.00;
						dz1 = l1 * (0.3 + 0.1);
						zk1 = o1 - e - dz1;
						printf("Order amount: %.2f\nE-coupon discount amount: %.2f\nDiscount amount: %.2f\nPayment amount: %.2f\n2", o1, e, dz1, zk1);
					}
				}
			}

			i++;
			if (i < q)
				goto begin;

		}

		return 0;
	}
}
